package com.todo.biz.infrastructure.repository.impl;


import com.todo.biz.infrastructure.entity.po.DetectionRecordPO;
import com.todo.biz.infrastructure.mapper.DetectionRecordMapper;
import com.todo.biz.infrastructure.repository.DetectionRecordRepository;
import com.todo.common.utils.TodoCommonUtils;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Date;

/**
 * @author azhebuxing
 * @date 2024/12/13 21:13
 * @description
 */
@Repository
public class DetectionRecordRepositoryImpl implements DetectionRecordRepository {

    @Resource
    private DetectionRecordMapper detectionRecordMapper;


    @Override
    public Boolean insertDetectionRecord(DetectionRecordPO detectionRecordPO) {
        if (detectionRecordPO == null){
            return false;
        }
        detectionRecordPO.setId(TodoCommonUtils.buildLongGuid());
        detectionRecordPO.setIsDelete(0);
        detectionRecordPO.setCreateTime(new Date());
        detectionRecordPO.setUpdateTime(new Date());
        return detectionRecordMapper.insertDetectionRecord(detectionRecordPO) > 0;
    }
}
